package com.zmn.plat.persistence.interfaces.channel.commission.settle.rule;

import com.zmn.plat.model.entity.channel.commission.settle.rule.ChannelCommissionSettleRule;
import com.zmn.plat.model.entity.channel.commission.settle.rule.ChannelCommissionSettleRuleQuery;
import java.util.List;

/**
 * 渠道佣金结算规则
 * 
 * @author linfeng
 *
 * @since 2020/10/26 10:31
 */
public interface ChannelCommissionSettleRuleDao {

    /**
     * 查询
     * @param relateId ID
     * @return
     */
    ChannelCommissionSettleRule findByKey(Integer relateId);

    /**
     * 根据渠道ID查询渠道佣金结算规则
     * @param channelId
     * @return
     */
    ChannelCommissionSettleRule findByChannelId(Integer channelId);

    /**
     * 分页搜索
     * @param query 条件
     * @return 列表
     */
    List<ChannelCommissionSettleRule> listPageByQuery(ChannelCommissionSettleRuleQuery query);

    /**
     * 搜索
     * @param query 条件
     * @return
     */
    List<ChannelCommissionSettleRule> listByQuery(ChannelCommissionSettleRuleQuery query);

    /**
     * 所有数据
     * @return
     */
    List<ChannelCommissionSettleRule> listAll();

    /**
     * 统计
     * @param query 条件
     * @return
     */
    Integer countByQuery(ChannelCommissionSettleRuleQuery query);
    /**
     * 更新
     * @param channelCommissionSettleRule
     * @return
     */
    Integer updateByKey(ChannelCommissionSettleRule channelCommissionSettleRule);

    /**
     * 插入
     * @param channelCommissionSettleRule
     * @return
     */
    Integer insert(ChannelCommissionSettleRule channelCommissionSettleRule);

    /**
     * 删除
     * @param relateId ID
     * @return
     */
    Integer deleteByKey(Integer relateId);

    /**
     * 描述: 从旧渠道复制到新渠道
     *
     * @param originalChannelId 原渠道ID
     * @param targetChannelId 新渠道ID
     * @param operator 操作者
     * @return java.lang.Boolean
     * @author guoqiao
     * @since 2021/6/8 13:49
     */
    void copy(Integer originalChannelId, int targetChannelId, String operator);
}
